package ru.chaykin.util;

public class Vector {
	private float x;
	private float y;
	
	public Vector(float x, float y) {
		this.x = x;
		this.y = y;
	}
	
	public void rotate(float angle) {
		float radAngle = (float) (angle * Math.PI / 180.0);
		float sinA = (float) Math.sin(radAngle);
		float cosA = (float) Math.cos(radAngle);
		float rotatedX = x * cosA + y * sinA;
		float rotatedY = y * cosA - x * sinA;
		x = rotatedX;
		y = rotatedY;
	}
	
	public float getX() {
		return x;
	}
	
	public float getY() {
		return y;
	}
}
